import api from './api';

// 创建订单
export const createOrder = async (data: {
  productType: string;
  productId?: string;
  amount: number;
}) => {
  return api.post('/payment/create-order', data);
};

// 支付订单（模拟支付）
export const payOrder = async (data: {
  orderNo: string;
  paymentType: string;
}) => {
  return api.post('/payment/pay-order', data);
};

// 充值钱包（模拟充值）
export const rechargeWallet = async (data: {
  amount: number;
  paymentType: string;
}) => {
  return api.post('/payment/recharge', data);
};

// 获取订单列表
export const getUserOrders = async (params: {
  page?: number;
  per_page?: number;
}) => {
  return api.get('/payment/orders', { params });
};

// 获取钱包信息
export const getWalletInfo = async () => {
  return api.get('/payment/wallet');
};
